Correction apparatus for angle sensor, and angle sensor

ABSTRACT

An angle sensor generates an angle detection value based on a first and a second detection signal. A correction apparatus performs correction processing for generating a first corrected detection signal by adding a first correction value to the first detection signal and generating a second corrected detection signal by adding a second correction value to the second detection signal. When an angle to be detected varies with a period T and if no correction processing is performed, the angle detection value contains an Nth-order angle error component varying with a period of T/N. Each of the first and second detection signals contains an (N−1)th-order signal error component and an (N+1)th-order signal error component. The order of the first and second correction values is N−1 or N+1.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to a correction apparatus for correctingerrors in an angle sensor configured to generate an angle detectionvalue having a correspondence with an angle to be detected, and to anangle sensor including the correction apparatus.

2. Description of the Related Art

In recent years, angle sensors have been widely used in variousapplications, such as detection of the rotational position of a steeringwheel or a power steering motor in an automobile. The angle sensorsgenerate an angle detection value having a correspondence with an angleto be detected. Examples of the angle sensors include a magnetic anglesensor. A system using the magnetic angle sensor is typically providedwith a magnetic field generator for generating a rotating magnetic fieldwhose direction rotates in response to the rotation or linear movementof an object. The magnetic field generator is a magnet, for example. Anexample of angles to be detected by the magnetic angle sensor is anangle corresponding to the rotational position of the magnet. Forexample, the magnetic angle sensor detects the foregoing rotatingmagnetic field and generates, as the angle detection value, a valuerepresenting the angle that a direction of the rotating magnetic fieldat a reference position forms with respect to a reference direction in areference plane.

A type of angle sensor is known that includes a detection signalgenerator for generating first and second detection signals 90°different in phase from each other and generates an angle detectionvalue by performing operations using the first and second detectionsignals. The detection signal generator includes a first detectioncircuit for outputting the first detection signal, and a seconddetection circuit for outputting the second detection signal. The firstand second detection circuits each include at least one magneticdetection element. The magnetic detection element includes, for example,a spin-valve magnetoresistive (MR) element including a magnetizationpinned layer whose magnetization direction is pinned, a free layer whosemagnetization direction changes with the direction of the rotatingmagnetic field, and a gap layer located between the magnetization pinnedlayer and the free layer.

When a magnetic angle sensor is detecting an angle that varies at aconstant velocity, each of the first and second detection signals shouldideally have a sinusoidal waveform (including a sine waveform and acosine waveform). However, each detection signal may sometimes have awaveform distorted from a sinusoidal one. In such cases, the firstdetection signal contains a first ideal component which varies in anideally sinusoidal manner, and one or more signal error components otherthan the first ideal component. Likewise, the second detection signalcontains a second ideal component which varies in an ideally sinusoidalmanner, and one or more signal error components other than the secondideal component. A distortion of the waveform of each detection signalmay result in some error in the angle detection value. An erroroccurring in the angle detection value will hereinafter be referred toas an angle error.

If the angle to be detected varies with a period T, the angle error cancontain a component varying with a period of T/N, where N is an integergreater than or equal to 1. Such a component will hereinafter bereferred to as an Nth-order angle error component.

Assume here that the angle to be detected is θ, the first idealcomponent is proportional to sin θ, and the second ideal component isproportional to cos θ. The first detection signal can contain a signalerror component proportional to sin(Mθ+α), and the second detectionsignal can contain a signal error component proportional to cos(Mθ+α),where M is an integer greater than or equal to 0, and α is apredetermined angle. These signal error components are herein defined asMth-order signal error components. M represents the order of each signalerror component.

An angle error can result when each of the first and second detectionsignals contains two signal error components of mutually differentorders. A typical method for reducing the angle error in such a case isto add to the first detection signal such a first correction value as tocancel out the two signal error components of the first detectionsignal, and add to the second detection signal such a second correctionvalue as to cancel out the two signal error components of the seconddetection signal. The first correction value used in this methodcontains two components having their respective periods the same as theperiods of the two signal error components of the first detectionsignal. Similarly, the second correction value contains two componentshaving their respective periods the same as the periods of the twosignal error components of the second detection signal. Such a method isdescribed in US 2007/0288187A1 and JP 2008-304249A, for example.

US 2017/0314975A1 describes a technique for reducing a fourth-orderangle error component occurring when each of the first and seconddetection signals contains third- and fifth-order signal errorcomponents. The technique reduces the fourth-order angle error componentby adding a first correction value to the first detection signal andadding a second correction value to the second detection signal.According to the technique, the first correction value has a firstamplitude and varies with a first period. The second correction valuehas a second amplitude and varies with a second period. The first andsecond amplitudes are of the same value. The first and second periodsare of the same value that is ⅓ or ⅕ the period T.

An Nth-order angle error component can result when each of the first andsecond detection signals contains two signal error components ofmutually different orders. Methods for reducing the Nth-order angleerror component in such a case will be discussed below.

According to the foregoing typical method, each of the first and secondcorrection values contains two components having their respectiveperiods. This makes the first and second correction values complicated,and consequently complicates the processing for reducing the Nth-orderangle error component.

The technique described in US 2017/0314975A1 is able to reduce the4th-order angle error component, but unable to reduce any Nth-orderangle error components where N is other than 4.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide a correctionapparatus for an angle sensor, and an angle sensor that are capable ofreducing an Nth-order angle error component that results when each of afirst and a second detection signal contains two signal error componentsof mutually different orders, with simple processing regardless of thevalue of N.

According to each of first and second aspects of the present invention,there is provided a correction apparatus for use with an angle sensor,the angle sensor including: a detection signal generator for generatinga first detection signal and a second detection signal each having acorrespondence with an angle to be detected; and an angle detector forgenerating an angle detection value based on the first and seconddetection signals, the angle detection value having a correspondencewith the angle to be detected. The correction apparatus is configured tocorrect the first and second detection signals.

According to the first aspect of the invention, there is provided anangle sensor including the foregoing detection signal generator, theforegoing angle detector, and the correction apparatus according to thefirst aspect of the invention. According to the second aspect of theinvention, there is provided an angle sensor including the foregoingdetection signal generator, the foregoing angle detector, and thecorrection apparatus according to the second aspect of the invention.

According to each of the first and second aspects of the invention, thecorrection apparatus includes a correction processor configured toperform correction processing for generating a first corrected detectionsignal by adding a first correction value to the first detection signaland generating a second corrected detection signal by adding a secondcorrection value to the second detection signal.

The first detection signal contains a first ideal component, a firstsignal error component, and a second signal error component. The seconddetection signal contains a second ideal component, a third signal errorcomponent, and a fourth signal error component. The first idealcomponent is expressed as A₀ sin θ, the second ideal component isexpressed as A₀ cos θ, the first signal error component is expressed as−A₁ sin((N−1)θ+α), the second signal error component is expressed as −A₂sin((N+1)θ+α), the third signal error component is expressed as A₁cos((N−1)θ+α), and the fourth signal error component is expressed as −A₂cos((N+1)θ+α), where θ represents the angle to be detected; N is aninteger greater than or equal to 1; A₀, A₁, and A₂ are real numbersother than 0; and α is a predetermined angle.

The angle detection value without the correction processing is referredto as an uncorrected angle detection value θp. The uncorrected angledetection value θp contains an error. When the angle θ to be detectedvaries with a predetermined period T, the error of the uncorrected angledetection value θp contains a component resulting from the first tofourth signal error components and varying with a period of T/N.

In the correction apparatus according to the first aspect of theinvention, the first correction value is expressed as −A₃sin((N−1)θp+α), and the second correction value is expressed as A₃cos((N−1)θp+α), where A₃ is a real number such that |A₁+A₂+A₃| is lessthan |A₁+A₂|. |A₁+A₂+A₃| may be less than or equal to |A₁+A₂|×0.5, ormay be 0.

In the correction apparatus according to the second aspect of theinvention, the first correction value is expressed as −A₄sin((N+1)θp+α), and the second correction value is expressed as −A₄cos((N+1)θp+α), where A₄ is a real number such that |A₁+A₂+A₄| is lessthan |A₁+A₂|. |A₁+A₂+A₄| may be less than or equal to |A₁+A₂|×0.5, ormay be 0.

In the angle sensor according to each of the first and second aspects ofthe invention, the first detection signal may have a correspondence withthe sine of a rotating field angle, and the second detection signal mayhave a correspondence with the cosine of the rotating field angle. Therotating field angle is an angle that the direction of a rotatingmagnetic field at a reference position forms with respect to a referencedirection in a reference plane, and that has a correspondence with theangle to be detected.

With the correction apparatus and angle sensor according to each of thefirst and second aspects of the invention, reduction of an Nth-orderangle error component occurring when each of first and second detectionsignals contains two signal error components of mutually differentorders is achieved with simple processing regardless of the value of N.

Other and further objects, features and advantages of the presentinvention will appear more fully from the following description.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a perspective view illustrating a schematic configuration ofan angle sensor system including an angle sensor according to a firstembodiment of the invention.

FIG. 2 is an explanatory diagram illustrating a reference plane in thefirst embodiment of the invention.

FIG. 3 is a block diagram illustrating the configuration of the anglesensor according to the first embodiment of the invention.

FIG. 4 is a circuit diagram illustrating the configuration of adetection signal generator in FIG. 3.

FIG. 5 is a perspective view of part of a magnetic detection element inFIG. 4.

FIG. 6 is a functional block diagram illustrating the configuration of acorrection apparatus in FIG. 3.

FIG. 7 is a waveform diagram illustrating a first example waveform of anangle error occurring in an angle detection value when no correctionprocessing is performed.

FIG. 8 is a waveform diagram illustrating a second example waveform ofthe angle error occurring in the angle detection value when nocorrection processing is performed.

FIG. 9 is a waveform diagram illustrating a third example waveform ofthe angle error occurring in the angle detection value when nocorrection processing is performed.

FIG. 10 is a waveform diagram illustrating a fourth example waveform ofthe angle error occurring in the angle detection value when nocorrection processing is performed.

FIG. 11 is a flowchart of a correction information determinationprocedure in the first embodiment of the invention.

FIG. 12 is a waveform diagram illustrating an example waveform of anerror of an uncorrected angle detection value in Example 1 of the firstembodiment of the invention.

FIG. 13 is a waveform diagram illustrating a first example waveform ofthe angle error in Example 1 of the first embodiment of the invention.

FIG. 14 is a waveform diagram illustrating a second example waveform ofthe angle error in Example 1 of the first embodiment of the invention.

FIG. 15 is a waveform diagram illustrating an example waveform of anerror in the uncorrected angle detection value in Example 2 of the firstembodiment of the invention.

FIG. 16 is a waveform diagram illustrating a first example waveform ofthe angle error in Example 2 of the first embodiment of the invention.

FIG. 17 is a waveform diagram illustrating a second example waveform ofthe angle error in Example 2 of the first embodiment of the invention.

FIG. 18 is a waveform diagram illustrating an example waveform of anerror in the uncorrected angle detection value in Example 3 of the firstembodiment of the invention.

FIG. 19 is a waveform diagram illustrating a first example waveform ofthe angle error in Example 3 of the first embodiment of the invention.

FIG. 20 is a waveform diagram illustrating a second example waveform ofthe angle error in Example 3 of the first embodiment of the invention.

FIG. 21 is a waveform diagram illustrating an example waveform of anerror in the uncorrected angle detection value in Example 4 of the firstembodiment of the invention.

FIG. 22 is a waveform diagram illustrating a first example waveform ofthe angle error in Example 4 of the first embodiment of the invention.

FIG. 23 is a waveform diagram illustrating a second example waveform ofthe angle error in Example 4 of the first embodiment of the invention.

FIG. 24 is a waveform diagram illustrating an example waveform of anerror in the uncorrected angle detection value in Example 5 of the firstembodiment of the invention.

FIG. 25 is a waveform diagram illustrating a first example waveform ofthe angle error in Example 5 of the first embodiment of the invention.

FIG. 26 is a waveform diagram illustrating a second example waveform ofthe angle error in Example 5 of the first embodiment of the invention.

FIG. 27 is a functional block diagram illustrating the configuration ofa correction apparatus according to a second embodiment of theinvention.

FIG. 28 is a waveform diagram illustrating a first example waveform ofthe angle error in Example 1 of the second embodiment of the invention.

FIG. 29 is a waveform diagram illustrating a second example waveform ofthe angle error in Example 1 of the second embodiment of the invention.

FIG. 30 is a waveform diagram illustrating a first example waveform ofthe angle error in Example 2 of the second embodiment of the invention.

FIG. 31 is a waveform diagram illustrating a second example waveform ofthe angle error in Example 2 of the second embodiment of the invention.

FIG. 32 is a waveform diagram illustrating a first example waveform ofthe angle error in Example 3 of the second embodiment of the invention.

FIG. 33 is a waveform diagram illustrating a second example waveform ofthe angle error in Example 3 of the second embodiment of the invention.

FIG. 34 is a waveform diagram illustrating a first example waveform ofthe angle error in Example 4 of the second embodiment of the invention.

FIG. 35 is a waveform diagram illustrating a second example waveform ofthe angle error in Example 4 of the second embodiment of the invention.

FIG. 36 is a waveform diagram illustrating a first example waveform ofthe angle error in Example 5 of the second embodiment of the invention.

FIG. 37 is a waveform diagram illustrating a second example waveform ofthe angle error in Example 5 of the second embodiment of the invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS First Embodiment

Preferred embodiments of the present invention will now be described indetail with reference to the drawings. First, reference is made to FIG.1 to describe a schematic configuration of an angle sensor systemincluding an angle sensor according to a first embodiment of theinvention.

The angle sensor system shown in FIG. 1 includes a magnetic fieldgenerator and the angle sensor 1 according to the first embodiment. Theangle sensor 1 is specifically a magnetic angle sensor.

FIG. 1 shows an example in which the magnetic field generator is amagnet 5 in the shape of a cylinder having a central axis. The magnet 5has an N pole and an S pole that are arranged symmetrically with respectto an imaginary plane including the aforementioned central axis. Themagnet 5 rotates about the central axis and thereby generates a rotatingmagnetic field MF. The rotating magnetic field MF is a magnetic fieldthat rotates about a center of rotation C including the aforementionedcentral axis.

The angle sensor 1 is configured to generate an angle detection value Oshaving a correspondence with an angle to be detected. Hereinafter, theangle to be detected will be referred to as detection-target angle, anddenoted by a symbol θ. The detection-target angle θ in the presentembodiment is an angle corresponding to the rotational position of themagnet 5.

The angle sensor 1 detects the rotating magnetic field MF and generates,as the angle detection value Os, a value representing a rotating fieldangle θM having a correspondence with the detection-target angle θ. Therotating field angle θM is an angle that the direction DM of therotating magnetic field MF at a reference position PR forms with respectto a reference direction DR in a reference plane P. FIG. 2 illustratesthe reference plane P, the reference position PR, the direction DM ofthe rotating magnetic field MF, the reference direction DR, and therotating field angle θM.

Now, definitions of directions used in the present embodiment will bedescribed with reference to FIG. 1 and FIG. 2. First, Z direction isdefined as the direction parallel to the center of rotation C shown inFIG. 1 and from bottom to top in FIG. 1. FIG. 2 illustrates the Zdirection as the direction out of the plane of the drawing. X and Ydirections are defined as two mutually orthogonal directionsperpendicular to the Z direction. FIG. 2 illustrates the X direction asthe rightward direction, and the Y direction as the upward direction.Further, −X direction refers to the direction opposite to the Xdirection, and −Y direction refers to the direction opposite to the Ydirection.

The reference plane P is an imaginary plane parallel to one end face ofthe magnet 5. The reference position PR is the position where the anglesensor 1 detects the rotating magnetic field MF. The reference directionDR is in the reference plane P and intersects the reference position PR.The direction DM of the rotating magnetic field MF at the referenceposition PR is also in the reference plane P. The angle sensor 1 isdisposed to face the aforementioned end face of the magnet 5. In thepresent embodiment, the reference direction DR is the X direction. Inthe reference plane P the direction DM of the rotating magnetic field MFrotates about the reference position PR. In the present embodiment, itis assumed that the direction DM of the rotating magnetic field MFrotates counterclockwise in FIG. 2. The rotating field angle θM isexpressed in positive values when viewed in the counterclockwisedirection from the reference direction DR, and in negative values whenviewed in the clockwise direction from the reference direction DR.

In the present embodiment, the rotating field angle θM coincides withthe detection-target angle θ if the magnet 5 generates an ideal rotatingmagnetic field MF. FIG. 2 shows the detection-target angle θ in such acase. However, the rotating field angle θM is not always ideal and mayslightly differ from the detection-target angle θ due to unevenmagnetization of the magnet 5 or other factors. This is a cause of anerror occurring in the angle detection value Os.

The angle sensor system of the present embodiment may be configured inother ways than illustrated in FIG. 1. The angle sensor system of thepresent embodiment need only be configured to vary the relativepositional relationship between the magnetic field generator and theangle sensor 1 such that the direction DM of the rotating magnetic fieldMF at the reference position PR rotates when viewed from the anglesensor 1. For example, the magnet 5 and the angle sensor 1 arranged asillustrated in FIG. 1 may be configured so that: the angle sensor 1rotates while the magnet 5 is fixed; the magnet 5 and the angle sensor 1rotate in mutually opposite directions; or the magnet 5 and the anglesensor 1 rotate in the same direction with mutually different angularvelocities.

Alternatively, as the magnetic field generator, a magnet including oneor more pairs of N and S poles arranged alternately in an annular shapemay be employed in place of the magnet 5, and the angle sensor 1 may beplaced in the vicinity of the outer circumference of the magnet. In sucha case, at least one of the magnet and the angle sensor 1 rotates.

Alternatively, as the magnetic field generator, a magnetic scale thatincludes a plurality of pairs of N and S poles arranged alternately in aliner configuration may be employed in place of the magnet 5, and theangle sensor 1 may be placed in the vicinity of the periphery of themagnetic scale. In such a case, at least one of the magnetic scale andthe angle sensor 1 moves linearly in the direction in which the N and Spoles of the magnetic scale are arranged.

In the above-described various configurations of the angle sensorsystem, there also exists the reference plane P having a predeterminedpositional relationship with the angle sensor 1. In the reference planeP, the direction DM of the rotating magnetic field MF rotates about thereference position PR when viewed from the angle sensor 1.

FIG. 3 is a block diagram illustrating the configuration of the anglesensor 1. As shown in FIG. 3, the angle sensor 1 includes: a detectionsignal generator 2 for generating a first detection signal S1 and asecond detection signal S2 each having a correspondence with thedetection-target angle θ; an angle detector 4 for generating, based onthe first and second detection signals S1 and S2, the angle detectionvalue θs having a correspondence with the detection-target angle θ; anda correction apparatus 3 according to the present embodiment.

In the present embodiment, specifically, the first detection signal S1has a correspondence with the sine of the rotating field angle θM, andthe second detection signal S2 has a correspondence with the cosine ofthe rotating field angle θM.

The correction apparatus 3 is an apparatus for correcting the first andsecond detection signals S1 and S2. The correction apparatus 3 correctsthe first detection signal S1 to generate a first corrected detectionsignal S1 c, and corrects the second detection signal S2 to generate asecond corrected detection signal S2 c, and supplies the first andsecond corrected detection signals S1 c and S2 c to the angle detector4. The angle detector 4 generates the angle detection value θs using thefirst and second corrected detection signals S1 c and S2 c.

As shown in FIG. 1, the detection signal generator 2 includes a firstdetection circuit 10 for generating the first detection signal S1 and asecond detection circuit 20 for generating the second detection signalS2. For ease of understanding, FIG. 1 illustrates the first and seconddetection circuits 10 and 20 as separate components. However, the firstand second detection circuits 10 and 20 may be integrated into a singlecomponent. Further, while in FIG. 1 the first and second detectioncircuits 10 and 20 are stacked in a direction parallel to the center ofrotation C, the order of stacking is not limited to the example shown inFIG. 1. Each of the first and second detection circuits 10 and 20includes at least one magnetic detection element for detecting therotating magnetic field MF.

The configuration of the detection signal generator 2 will now bedescribed in detail with reference to FIG. 4. FIG. 4 is a circuitdiagram illustrating the configuration of the detection signal generator2. As mentioned above, the detection signal generator 2 includes thefirst detection circuit 10 for generating the first detection signal S1and the second detection circuit 20 for generating the second detectionsignal S2.

The first detection circuit 10 includes a Wheatstone bridge circuit 14and a difference detector 15. The Wheatstone bridge circuit 14 includesfour magnetic detection elements R11, R12, R13 and R14, a power supplyport V1, a ground port G1, and two output ports E11 and E12. Themagnetic detection element R11 is provided between the power supply portV1 and the output port E11. The magnetic detection element R12 isprovided between the output port E11 and the ground port G1. Themagnetic detection element R13 is provided between the power supply portV1 and the output port E12. The magnetic detection element R14 isprovided between the output port E12 and the ground port G1. A powersupply voltage of predetermined magnitude is applied to the power supplyport V1. The ground port G1 is connected to the ground. The differencedetector 15 outputs a signal corresponding to the potential differencebetween the output ports E11 and E12 as the first detection signal S1.

The circuit configuration of the second detection circuit 20 is similarto that of the first detection circuit 10. More specifically, the seconddetection circuit 20 includes a Wheatstone bridge circuit 24 and adifference detector 25. The Wheatstone bridge circuit 24 includes fourmagnetic detection elements R21, R22, R23 and R24, a power supply portV2, a ground port G2, and two output ports E21 and E22. The magneticdetection element R21 is provided between the power supply port V2 andthe output port E21. The magnetic detection element R22 is providedbetween the output port E21 and the ground port G2. The magneticdetection element R23 is provided between the power supply port V2 andthe output port E22. The magnetic detection element R24 is providedbetween the output port E22 and the ground port G2. A power supplyvoltage of predetermined magnitude is applied to the power supply portV2. The ground port G2 is connected to the ground. The differencedetector 25 outputs a signal corresponding to the potential differencebetween the output ports E21 and E22 as the second detection signal S2.

The magnetic detection elements R11 to R14 and R21 to R24 may eachinclude a plurality of magnetoresistive (MR) elements connected inseries. Each of the plurality of MR elements is a spin-valve MR element,for example. The spin-valve MR element includes a magnetization pinnedlayer whose magnetization direction is pinned, a free layer which is amagnetic layer whose magnetization direction changes with the directionDM of the rotating magnetic field MF at the reference position PR, and agap layer located between the magnetization pinned layer and the freelayer. The spin-valve MR element may be a tunneling magnetoresistive(TMR) element or a giant magnetoresistive (GMR) element. In the TMRelement, the gap layer is a tunnel barrier layer. In the GMR element,the gap layer is a nonmagnetic conductive layer. The resistance of thespin-valve MR element changes with the angle that the magnetizationdirection of the free layer forms with respect to the magnetizationdirection of the magnetization pinned layer. The resistance of thespin-valve MR element is at its minimum value when the foregoing angleis 0°, and at its maximum value when the foregoing angle is 180°. InFIG. 4, the filled arrows indicate the magnetization directions of themagnetization pinned layers of the MR elements, and the hollow arrowsindicate the magnetization directions of the free layers of the MRelements.

In the first detection circuit 10, the magnetization pinned layers ofthe MR elements included in the magnetic detection elements R11 and R14are magnetized in the Y direction, and the magnetization pinned layersof the MR elements included in the magnetic detection elements R12 andR13 are magnetized in the −Y direction. In this case, the potentialdifference between the output ports E11 and E12 changes with the sine ofthe rotating field angle θM. The first detection signal S1 thus has acorrespondence with the sine of the rotating field angle θM. Since therotating field angle θM has a correspondence with the detection-targetangle θ, the first detection signal S1 has a correspondence with thedetection-target angle θ.

In the second detection circuit 20, the magnetization pinned layers ofthe MR elements included in the magnetic detection elements R21 and R24are magnetized in the X direction, and the magnetization pinned layersof the MR elements included in the magnetic detection elements R22 andR23 are magnetized in the −X direction. In this case, the potentialdifference between the output ports E21 and E22 changes with the cosineof the rotating field angle θM. The second detection signal S2 thus hasa correspondence with the cosine of the rotating field angle θM. Sincethe rotating field angle θM has a correspondence with thedetection-target angle θ, the second detection signal S2 has acorrespondence with the detection-target angle θ.

In consideration of the production accuracy of the MR elements and otherfactors, the magnetization directions of the magnetization pinned layersof the MR elements in the detection circuits 10 and 20 may be slightlydifferent from the above-described directions.

An example configuration of the magnetic detection elements will now bedescribed with reference to FIG. 5. FIG. 5 is a perspective view of partof a magnetic detection element in the detection signal generator 2 inFIG. 4. In this example, the magnetic detection element includes aplurality of lower electrodes 62, a plurality of MR elements 50 and aplurality of upper electrodes 63. The lower electrodes 62 are arrangedon a substrate (not illustrated). The lower electrodes 62 each have along slender shape. Every two lower electrodes 62 that are adjacent toeach other in the longitudinal direction of the lower electrodes 62 havea gap therebetween. As shown in FIG. 5, MR elements 50 are provided onthe top surface of the lower electrode 62 at positions near oppositeends in the longitudinal direction. Each MR element 50 includes a freelayer 51, a gap layer 52, a magnetization pinned layer 53, and anantiferromagnetic layer 54 which are stacked in this order, from closestto farthest from the lower electrode 62. The free layer 51 iselectrically connected to the lower electrode 62. The antiferromagneticlayer 54 is formed of an antiferromagnetic material, and is in exchangecoupling with the magnetization pinned layer 53 to thereby pin themagnetization direction of the magnetization pinned layer 53. The upperelectrodes 63 are arranged over the MR elements 50. Each upper electrode63 has a long slender shape, and establishes electrical connectionbetween the respective antiferromagnetic layers 54 of two adjacent MRelements 50 that are arranged on two lower electrodes 62 adjacent in thelongitudinal direction of the lower electrodes 62. With such aconfiguration, the MR elements 50 in the magnetic detection elementshown in FIG. 5 are connected in series by the upper and lowerelectrodes 63 and 62. It should be appreciated that the layers 51 to 54of the MR elements 50 may be stacked in the reverse order to that shownin FIG. 5.

Next, reference is made to FIG. 6 to describe the configuration of thecorrection apparatus 3 in detail. FIG. 6 is a functional block diagramillustrating the configuration of the correction apparatus 3. Thecorrection apparatus 3 includes analog-to-digital converters(hereinafter, “A/D converters”) 31 and 32, and a correction processor33. The correction processor 33 and the angle detector 4 use digitalsignals. The A/D converter 31 converts the first detection signal S1into digital form. The A/D converter 32 converts the second detectionsignal S2 into digital form.

The correction processor 33 and the angle detector 4 can be implementedby an application-specific integrated circuit (ASIC) or a microcomputer,for example.

The correction processor 33 performs correction processing. Thecorrection processing is processing to generate the first correcteddetection signal S1 c by adding a first correction value C1 to the firstdetection signal S1 converted into digital form by the A/D converter 31,and generate the second corrected detection signal S2 c by adding asecond correction value C2 to the second detection signal S2 convertedinto digital form by the A/D converter 32. In the following description,the first detection signal S1 to be handled in the correction processingrefers to the one converted into digital form by the A/D converter 31,and the second detection signal S2 to be handled in the correctionprocessing refers to the one converted into digital form by the A/Dconverter 32.

As mentioned previously, the first and second corrected detectionsignals S1 c and S2 c are supplied to the angle detector 4. The angledetector 4 generates the angle detection value θs using the first andsecond corrected detection signals S1 c and S2 c.

The correction processor 33 includes adders 34 and 35, a correctionvalue generator 36, and a correction information storage unit 37. Theadder 34 performs processing to add the first correction value C1 to thefirst detection signal S1 to generate the first corrected detectionsignal S1 c. The adder 35 performs processing to add the secondcorrection value C2 to the second detection signal S2 to generate thesecond corrected detection signal S2 c.

The correction value generator 36 generates the first and secondcorrection values C1 and C2, supplies the first correction value C1 tothe adder 34, and supplies the second correction value C2 to the adder35. The correction information storage unit 37 stores correctioninformation that is necessary for the generation of the first and secondcorrection values C1 and C2 by the correction value generator 36, andsupplies the correction information to the correction value generator36. The correction value generator 36 uses the first and seconddetection signals S1 and S2 and the correction information to generatethe first and second correction values C1 and C2. The details of thecorrection processing will be described in detail later.

Now, a description will be given of error components of the first andsecond detection signals S1 and S2 and an error caused in the angledetection value θs by the error components.

As mentioned previously, in the present embodiment the first detectionsignal S1 has a correspondence with the sine of the rotating field angleθM, and the second detection signal S2 has a correspondence with thecosine of the rotating field angle θM. Ideally, the first detectionsignal S1 should be expressed as A₀ sin θ, and the second detectionsignal S2 as A₀ cos θ, where A₀ is a real number other than 0. In thepresent embodiment, A₀ sin θ will be referred to as a first idealcomponent, and A₀ cos θ as a second ideal component.

In actuality, the first detection signal S1 contains the first idealcomponent and one or more error components other than the first idealcomponent, and the second detection signal S2 contains the second idealcomponent and one or more error components other than the second idealcomponent. In the present embodiment, the one or more error componentscontained in each of the first and second detection signals S1 and S2will be referred to as one or more signal error components.

There are broadly two causes of the one or more signal error componentsoccurring in each of the first and second detection signals S1 and S2. Afirst cause is related to the rotating magnetic field MF. A second causeis related to the detection signal generator 2. The first cause is that,as mentioned previously, the rotating field angle θM fails to be anideal one and thus differs slightly from the detection-target angle θdue to uneven magnetization of the magnet 5 or other factors. Specificexamples of the second cause include the following situations: 1) thefree layers 51 of MR elements 50 have magnetic anisotropy in thedirection of magnetization of the magnetization pinned layers 53 of theMR elements 50; 2) the direction of magnetization of the magnetizationpinned layers 53 of MR elements 50 fluctuates due to the effect of therotating magnetic field MF or other factors; 3) the free layers 51 of MRelements 50 in the first detection circuit 10 and those in the seconddetection circuit 20 have magnetic anisotropy in the same direction; and4) there is misalignment between the magnet 5 and the detection signalgenerator 2.

The one or more signal error components of each of the first and seconddetection signals S1 and S2 can be caused by at least one of the firstcause and the second cause.

If no correction processing is performed, an error can occur in theangle detection value θs due to the one or more signal error componentscontained in each of the first and second detection signals S1 and S2.In the present embodiment, the error occurring in the angle detectionvalue θs will be referred to as an angle error.

If the detection-target angle θ varies with a predetermined period T,the angle error can contain a component varying with a period of T/N,where N is an integer greater than or equal to 1. Such a component willhereinafter be referred to as an Nth-order angle error component.

The first detection signal S1 can contain a signal error componentproportional to sin(Mθ+α), and the second detection signal S2 cancontain a signal error component proportional to cos(Mθ+α), where M isan integer greater than or equal to 0, and α is a predetermined angle.Such signal error components are herein defined as Mth-order signalerror components. M represents the order of each signal error component.In the present embodiment, signal error components are distinguished bythe value of M.

Now, a description will be given of findings from researches by theinventor of the present invention about a relationship between signalerror components and angle error components. For simplicity ofdescription, suppose that the first detection signal S1 contains onlythe first ideal component (A₀ sin θ) and an Mth-order signal errorcomponent, and the second detection signal S2 contains only the secondideal component (A₀ cos θ) and an Mth-order signal error component.Suppose also that the Mth-order signal error component of the firstdetection signal S1 and the Mth-order signal error component of thesecond detection signal S2 have the same value of M and the sameamplitude. In this case, the first detection signal S1 and the seconddetection signal S2 are expressed in a pair of Eqs. (1) and (2) or apair of Eqs. (3) and (4) below, where B₀ is a real number other than 0.

S1=A ₀ sin θ−B ₀ sin(Mθ+α)  (1)

S2=A ₀ cos θ+B ₀ cos(Mθ+α)  (2)

S1=A ₀ sin θ−B ₀ sin(Mθ+α)  (3)

S2=A ₀ cos θ−B ₀ cos(Mθ+α)  (4)

In the pair of Eqs. (1) and (2), the terms of the Mth-order signal errorcomponents of the first and second detection signals S1 and S2 havedifferent signs. In Eqs. (1) and (2), the term of the Mth-order signalerror component of the first detection signal S1 has a sign “−”, whereasthe term of the Mth-order signal error component of the second detectionsignal S2 has a sign “+”. However, the signs may be reversed.

In the pair of Eqs. (3) and (4), the terms of the Mth-order signal errorcomponents of the first and second detection signals S1 and S2 have thesame sign. In Eqs. (3) and (4), both of the term of the Mth-order signalerror component of the first detection signal S1 and the term of theMth-order signal error component of the second detection signal S2 havea sign “−”. However, the terms may both have a sign “+”.

The inventor of the present invention has found the following first tothird characteristics about the relationship between the signal errorcomponents and angle error components. The first characteristic is thatwith the first and second detection signals S1 and S2 expressed in thepair of Eqs. (1) and (2), an (M+1)th-order angle error component mainlyoccurs in the angle detection value θs if no correction processing isperformed, whereas with the first and second detection signals S1 and S2expressed in the pair of Eqs. (3) and (4), an (M−1)th-order angle errorcomponent mainly occurs in the angle detection value θs if no correctionprocessing is performed.

The second characteristic is that the ratio of the amplitude of the mainangle error component to B₀ does not differ between the case with thefirst and second detection signals S1 and S2 expressed in the pair ofEqs. (1) and (2) and the case with the first and second detectionsignals S1 and S2 expressed in the pair of Eqs. (3) and (4).

The third characteristic is that, in both of the case with the first andsecond detection signals S1 and S2 expressed in the pair of Eqs. (1) and(2) and the case with the first and second detection signals S1 and S2expressed in the pair of Eqs. (3) and (4), the phase of the main angleerror component is reversed depending on whether B₀ is a positive valueor a negative value.

The foregoing first to third characteristics hold true regardless of thevalue of M, provided that M is an integer greater than or equal to 0.

FIGS. 7 to 10 show specific examples showing the foregoing first tothird characteristics. In the examples, an angle error occurring in theangle detection value θs without the correction processing wasdetermined on the assumption that M is 3, A₀ is 1, B₀ is 0.02 or −0.02,and α is 0. FIGS. 7 to 10 show first to fourth example waveforms of theangle error. In FIGS. 7 to 10, the horizontal axis represents thedetection-target angle θ, and the vertical axis represents the angleerror.

FIG. 7 shows the waveform of the angle error in a case where B₀ is 0.02and the first and second detection signals S1 and S2 are expressed inthe pair of Eqs. (1) and (2). FIG. 8 shows the waveform of the angleerror in a case where B₀ is 0.02 and the first and second detectionsignals S1 and S2 are expressed in the pair of Eqs. (3) and (4).

FIGS. 7 and 8 show the foregoing first and second characteristics. Morespecifically, the angle error shown in FIG. 7 mainly contains afourth-order angle error component, and the angle error shown in FIG. 8mainly contains a second-order angle error component. The fourth-orderangle error component in FIG. 7 and the second-order angle errorcomponent in FIG. 8 have the same amplitude.

FIG. 9 shows the waveform of the angle error in a case where B₀ is −0.02and the first and second detection signals S1 and S2 are expressed inthe pair of Eqs. (1) and (2). FIG. 10 shows the waveform of the angleerror in a case where B₀ is −0.02 and the first and second detectionsignals S1 and S2 are expressed in the pair of Eqs. (3) and (4).

FIGS. 9 and 10 also show the foregoing first and second characteristics.FIGS. 7 and 9 show the foregoing third characteristic. Morespecifically, the 4th-order angle error components in FIGS. 7 and 9 haveopposite phases. FIGS. 8 and 10 also show the third characteristic. Morespecifically, the 2nd-order angle error components in FIGS. 8 and 10have opposite phases.

As seen from the foregoing first characteristic, when each of the firstand second detection signals S1 and S2 contains two signal errorcomponents of different orders, an Nth-order angle error component canoccur in the angle detection value θs if no correction processing isperformed. Specifically, the two signal error components of the firstdetection signal S1 are an (N−1)th-order signal error componentcorresponding to the signal error component in Eq. (1) and an(N+1)th-order signal error component corresponding to the signal errorcomponent in Eq. (3). The two signal error components of the seconddetection signal S2 are an (N−1)th-order signal error componentcorresponding to the signal error component in Eq. (2) and an(N+1)th-order signal error component corresponding to the signal errorcomponent in Eq. (4). The correction apparatus 3 according to thepresent embodiment is configured to correct the first and seconddetection signals S1 and S2 to reduce the Nth-order angle errorcomponent in such a case.

Next, the correction processing according to the present embodiment willbe described in detail. In the present embodiment, the first detectionsignal S1 contains the first ideal component expressed as A₀ sin θ, afirst signal error component expressed as −A₁ sin((N−1)θ+α), and asecond signal error component expressed as A₂ sin((N+1)θ+α), where A₁and A₂ are real numbers other than 0. The second detection signal S2contains the second ideal component expressed as A₀ cos θ, a thirdsignal error component expressed as A₁ cos((N−1)θ+α), and a fourthsignal error component expressed as −A₂ cos((N+1)θ+α).

The first signal error component and the third signal error componentare (N−1)th-order signal error components corresponding to the signalerror components in Eqs. (1) and (2). The second signal error componentand the fourth signal error component are (N+1)th-order signal errorcomponents corresponding to the signal error components in Eqs. (3) and(4).

For simplicity of description below, assume that the first detectionsignal S1 contains only the first ideal component and first and secondsignal error components, and the second detection signal S2 containsonly the second ideal component and third and fourth signal errorcomponents. In such a case, the first and second detection signals S1and S2 are expressed in Eqs. (5) and (6) below.

S1=A ₀ sin θ−A ₁ sin((N−1)θ+α)−A ₂ sin((N+1)θ+α)  (5)

S2=A ₀ cos θ+A ₁ cos((N−1)θ+α)−A ₂ cos((N+1)θ+α)  (6)

If the detection-target angle θ varies with a predetermined period T,the angle detection value θs without the correction processing containsa component resulting from the first to fourth signal error componentsand varying with a period of T/N, i.e., an Nth-order angle errorcomponent.

The present embodiment uses the foregoing first to third characteristicsto reduce the N-th order angle error component in the following manner.

Suppose here that the correction processing can determine the firstcorrection value C1 to be −A₃ sin((N−1)θ+α) and the second correctionvalue C2 to be A₃ cos((N−1)θ+α). In such a case, reduction in amplitudeof the Nth-order angle error component is achieved by setting A₃ to areal number such that |A₁+A₂+A₃| is less than |A₁+A₂|. In actuality,however, it is not possible to determine the first and second correctionvalues C1 and C2 as above since the detection-target angle θ is unknownto the correction processor 33.

To address this problem, in the correction processing according to thepresent embodiment, the correction value generator 36 uses anuncorrected angle detection value θp instead of the detection-targetangle θ to determine the first and second correction values C1 and C2expressed in Eqs. (7) and (8) below. The uncorrected angle detectionvalue θp is an angle detection value without the correction processing.A₃ is a real number such that |A₁+A₂+A₃| is less than |A₁+A₂|.|A₁+A₂+A₃| is preferably less than or equal to |A₁+A₂|×0.5. Morepreferably, |A₁+A₂+A₃| is 0.

C1=−A ₃ sin((N−1)θp+α)  (7)

C2=A ₃ cos((N−1)θp+α)  (8)

If the first and second correction values C1 and C2 have a period of T/Dwhen the detection-target angle θ varies with a period T, we say thatthe order of each of the first and second correction values C1 and C2 isD. In the present embodiment, specifically, the order of each of thefirst and second correction values C1 and C2 is N−1.

The correction information storage unit 37 stores the respective valuesof N, A₃ and α as the correction information, and supplies the values tothe correction value generator 36. The correction value generator 36uses the values of N, A₃ and a to determine the first and secondcorrection values C1 and C2 expressed in Eqs. (7) and (8).

The correction value generator 36 may compute the uncorrected angledetection value θp in accordance with Eq. (9) below, using the first andsecond detection signals S1 and S2. The correction value generator 36may then determine the first and second correction values C1 and C2 bysubstituting the values of N, A₃, and a supplied as correctioninformation and the computed uncorrected angle detection value θp intoEqs. (7) and (8).

θp=a tan(S1/S2)  (9)

In Eq. (9) “a tan” represents an arctangent.

For θp ranging from 0° to less than 360°, Eq. (9) yields two solutionsof θp that are 180° different in value. Which of the two solutions of θpin Eq. (9) is the true value of θp can be determined in accordance withthe combination of the signs of S1 and S2. The correction valuegenerator 36 determines θp within the range of 0° to less than 360° inaccordance with Eq. (9) and the determination on the combination of thesigns of S1 and S2.

In some cases, the correction value generator 36 can determine the firstand second correction values C1 and C2 without computing the uncorrectedangle detection value θp. For example, if N is 1, then (N−1)θp in Eqs.(7) and (8) makes 0. In this case, both the first and second correctionvalues C1 and C2 are constant values that do not vary with theuncorrected angle detection value θp.

If N is 2, then (N−1)θp in Eqs. (7) and (8) makes θp. In this case, Eqs.(7) and (8) can be modified to express C1 and C2 with sin θp and cos θpas variables. Here, sin θp and cos θp respectively represent the valuesof the first detection signal S1 and the second detection signal S2normalized so that the amplitude is 1. In this case, the first andsecond correction values C1 and C2 can be determined based on the firstand second detection signals S1 and S2 without computing the uncorrectedangle detection value θp.

Even if N is 3 or more, Eqs. (7) and (8) can sometimes be modified toexpress C1 and C2 with sin θp and cos θp as variables. In such cases,the first and second correction values C1 and C2 can be determined basedon the first and second detection signals S1 and S2 without computingthe uncorrected angle detection value θp.

The correction value generator 36 supplies the first correction value C1to the adder 34, and the second correction value C2 to the adder 35. Theadder 34 adds the first correction value C1 to the first detectionsignal S1 to generate the first corrected detection signal S1 c. Theadder 35 adds the second correction value C2 to the second detectionsignal S2 to generate the second corrected detection signal S2 c. Thefirst and second corrected detection signals S1 c and S2 c are expressedin Eqs. (10) and (11) below, respectively.

$\begin{matrix}{{S\; 1c} = {{{S\; 1} + {C\; 1}} = {{A_{0}\sin \mspace{11mu} \theta} - {A_{1}{\sin \left( {{\left( {N - 1} \right)\mspace{11mu} \theta} + \alpha} \right)}} - {A_{2}{\sin \left( {{\left( {N + 1} \right)\mspace{11mu} \theta} + \alpha} \right)}} - {A_{3}{\sin \left( {{\left( {N - 1} \right)\mspace{11mu} \theta \; p} + \alpha} \right)}}}}} & (10) \\{{S\; 2c} = {{{S\; 2} + {C\; 2}} = {{A_{0}\cos \mspace{11mu} \theta} + {A_{1}\cos \; \left( {{\left( {N - 1} \right)\mspace{11mu} \theta} + \alpha} \right)} - {A_{2}{\cos \left( {{\left( {N - 1} \right)\mspace{11mu} \theta} + \alpha} \right)}} + {A_{3}{\cos \left( {{\left( {N + 1} \right)\mspace{11mu} \theta \; p} + \alpha} \right)}}}}} & (11)\end{matrix}$

The first and second corrected detection signals S1 c and S2 c aresupplied to the angle detector 4 shown in FIG. 3. The angle detector 4uses the first and second corrected detection signals S1 c and S2 c togenerate the angle detection value θs in accordance with Eq. (12) below.

θs=a tan(S1c/S2c)  (12)

For θs ranging from 0° to less than 360°, Eq. (12) yields two solutionsof θs that are 180° different in value. Which of the two solutions of θsin Eq. (12) is the true value of θs can be determined in accordance withthe combination of the signs of S1 c and S2 c. The angle detector 4determines θs within the range of 0° to less than 360° in accordancewith Eq. (12) and the determination on the combination of the signs ofS1 c and S2 c.

The correction information to be stored in the correction informationstorage unit 37 is determined using a control unit (not shown) outsidethe angle sensor 1 and supplied to the correction information storageunit 37 before shipment or use of the angle sensor 1. This procedurewill be referred to as correction information determination procedure.The correction information determination procedure will now be describedwith reference to FIG. 11. FIG. 11 is a flowchart of the correctioninformation determination procedure.

The correction information determination procedure is performed beforeshipment or use of the angle sensor 1. The correction informationdetermination procedure is performed in a situation where the controlunit can recognize the detection-target angle θ. Examples of such asituation include when the detection-target angle θ is changed at thecommand of the control unit and when the control unit can obtaininformation on the detection-target angle θ.

The correction information determination procedure starts with step S101where the first and second detection signals S1 and S2 converted intodigital form by the A/D converters 31 and 32 are obtained during oneperiod of variation of the detection-target angle θ. Further, in stepS101, the uncorrected angle detection value θp is computed in accordancewith the foregoing Eq. (9) and an error Ep of the uncorrected angledetection value θp is computed in accordance with the following Eq. (13)during one period of variation of the detection-target angle θ.

Ep=θp−θ  (13)

The correction information determination procedure then continues tostep S102 where the error Ep computed during the one period of variationof the detection-target angle θ is analyzed to extract a component thatis a principle component of the error Ep and varies with a period of 1/Nthe period T of the detection-target angle θ, and the value of Ncorresponding to such a component is determined as the value of Nserving as the correction information. The analysis of the error Ep isperformed using Fourier analysis, for example.

The correction information determination procedure then continues tostep S103 where the first and second detection signals S1 and S2obtained during the one period of variation of the detection-targetangle θ are analyzed to extract the first to fourth signal errorcomponents corresponding to the value of N determined in step S102. Theanalysis of the first and second detection signals S1 and S2 isperformed using Fourier analysis, for example. Further, in step S103,the extracted first to fourth signal error components are also analyzedto determine the values of A₁, A₂, and α. The value of α determined instep S103 is the value of α serving as the correction information.

The correction information determination procedure then continues tostep S104 where A₃ is determined based on A₁ and A₂ determined in stepS103. A₃ is determined so that |A₁+A₂+A₃| is less than |A₁+A₂|. Thecorrection information determination procedure then ends. A₃ ispreferably determined so that |A₁+A₂+A₃| is less than or equal to|A₁+A₂|×0.5, more preferably, |A₁+A₂+A₃| is 0.

If |A₁+A₂+A₃| is less than |A₁+A₂|, it is possible to achieve areduction in amplitude of the Nth-order angle error component ascompared to when no correction processing is performed. If |A₁+A₂+A₃| isless than or equal to |A₁+A₂|×0.5, it is possible to reduce theamplitude of the Nth-order angle error component to approximately onehalf that in the case where no correction processing is performed. If|A₁+A₂+A₃| is 0, it is possible to make the amplitude of the Nth-orderangle error component almost zero.

As described above, the correction apparatus 3 and the angle sensor 1according to the present embodiment are capable of reducing theNth-order angle error component as compared to when no correctionprocessing is performed. The applicability of the correction processingaccording to the present embodiment does not depend on the value of N,provided that N is an integer greater than or equal to 1.

In the present embodiment, each of the first and second detectionsignals S1 and S2 contains two signal error components of the (N−1)thand (N+1)th orders. A typical method for reducing the angle error insuch a case is to add to the first detection signal S1 such a firstcorrection value as to cancel out the two signal error components of thefirst detection signal S1 and add to the second detection signal S2 sucha second correction value as to cancel out the two signal errorcomponents of the second detection signal S2. However, the first andsecond correction values used in such a method each contain twocomponents having their respective periods. This makes the first andsecond correction values complicated, and consequently complicates theprocessing for reducing the Nth-order angle error component.

In contrast, in the present embodiment, each of the first and secondcorrection values C1 and C2 contains only an (N−1)th-order componenteven though each of the first and second detection signals S1 and S2contains two signal error components of the (N−1)th and (N+1)th orders.Thus, in the present embodiment the first and second correction valuesC1 and C2 are simplified and the correction processing is simplified aswell.

Consequently, according to the present embodiment, an Nth-order angleerror component that results when each of the first and second detectionsignals S1 and S2 contains two signal error components of differentorders is reduced with simple processing regardless of the value of N.

Examples 1 to 5 of the present embodiment will now be described. In thefollowing description, the angle error, i.e., an error of the angledetection value θs in the present embodiment, will be denoted by thesymbol Es. The angle error Es is expressed in Eq. (14) below.

Es=θs−θ  (14)

Example 1

Example 1 deals with a case where N is 1. If N is 1, Eqs. (7) and (8)yield the following Eqs. (15) and (16).

C1=−A ₃ sin α  (15)

C2=A ₃ cos α  (16)

As can be seen from Eqs. (15) and (16), if N is 1, both the first andsecond correction values C1 and C2 are constant values that do not varywith the uncorrected angle detection value θp. If N is 1, the(N−1)th-order signal error components of the detection signals S1 and S2have constant values that do not vary with the detection-target angle θ.The periods of the (N−1)th-order signal error components and correctionvalues C1 and C2 where N=1 can be said to be infinite.

If N is 1, Eqs. (10) and (11) yield the following Eqs. (17) and (18).

S1c=A ₀ sin θ−A ₁ sin α−A ₂ sin(2θ+α)−A ₃ sin α  (17)

S2c=A ₀ cos θ+A ₁ cos α−A ₂ cos(2θ+α)+A ₃ cos α  (18)

Now, specific examples of the cases where A₀=1, A₁=0.01, A₂=0.01 andα=30° will be described with reference to FIG. 12 to FIG. 14.

FIG. 12 is a waveform diagram illustrating the waveform of the error Epof the uncorrected angle detection value θp. In FIG. 12, the horizontalaxis represents the detection-target angle θ, and the vertical axisrepresents the error Ep.

FIG. 13 is a waveform diagram illustrating the waveform of the angleerror Es when A₃ is −0.01. In FIG. 13, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₃ is −0.01, then |A₁+A₂+A₃| is equal to |A₁+A₂|×0.5. Inthis case, the maximum absolute value of the angle error Es isapproximately one half that of the error Ep shown in FIG. 12.

FIG. 14 is a waveform diagram illustrating the waveform of the angleerror Es when A₃ is −0.02. In FIG. 14, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₃ is −0.02, then |A₁+A₂+A₃| is 0. In this case, theabsolute value of the angle error Es is 0 regardless of θ.

Example 2

Example 2 deals with a case where N is 2. If N is 2, Eqs. (7) and (8)yield the following Eqs. (19) and (20).

C1=−A ₃ sin(θp+α)  (19)

C2=A ₃ cos(θp+α)  (20)

As can be seen from Eqs. (19) and (20), if N is 2, both the first andsecond correction values C1 and C2 vary with the uncorrected angledetection value θp.

If N is 2, Eqs. (10) and (11) yield the following Eqs. (21) and (22).

S1c=A ₀ sin θ−A ₁ sin(θ+α)−A ₂ sin(3θ+α)−A ₃ sin(θp+α)  (21)

S2c=A ₀ cos θ+A ₁ cos(θ+α)−A ₂ cos(30+α)+A ₃ cos(θp+α)  (22)

As described above, if N is 2, Eqs. (19) and (20) can be modified toexpress C1 and C2 with sin θp and cos θp as variables. Modifying Eqs.(19) and (20) yields Eqs. (23) and (24) below. In such a case, asmentioned above, the first and second correction values C1 and C2 can bedetermined based on the first and second detection signals S1 and S2without computing the uncorrected angle detection value θp.

C1=−A ₃|sin θp·cos α+cos θp·sin α  (23)

C2=A ₃{cos θp·cos α−sin θp·sin α}  (24)

Now, specific examples of the cases where A₀=1, A₁=0.01, A₂=0.01 andα=30° will be described with reference to FIG. 15 to FIG. 17.

FIG. 15 is a waveform diagram illustrating the waveform of the error Epof the uncorrected angle detection value θp. In FIG. 15, the horizontalaxis represents the detection-target angle θ, and the vertical axisrepresents the error Ep.

FIG. 16 is a waveform diagram illustrating the waveform of the angleerror Es when A₃ is −0.01. In FIG. 16, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₃ is −0.01, then |A₁+A₂+A₃| is equal to |A₁+A₂|×0.5. Inthis case, the maximum absolute value of the angle error Es isapproximately one half that of the error Ep shown in FIG. 15.

FIG. 17 is a waveform diagram illustrating the waveform of the angleerror Es when A₃ is −0.02. In FIG. 17, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₃ is −0.02, then |A₁+A₂+A₃| is 0. In this case, themaximum absolute value of the angle error Es is much smaller than thatof the error Ep shown in FIG. 15.

Example 3

Example 3 deals with a case where N is 3. Now, specific examples of thecases where A₀=1, A₁=0.01, A₂=0.01, and α=30° will be described withreference to FIG. 18 to FIG. 20.

FIG. 18 is a waveform diagram illustrating the waveform of the error Epof the uncorrected angle detection value θp. In FIG. 18, the horizontalaxis represents the detection-target angle θ, and the vertical axisrepresents the error Ep.

FIG. 19 is a waveform diagram illustrating the waveform of the angleerror Es when A₃ is −0.01. In FIG. 19, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₃ is −0.01, then |A₁+A₂+A₃| is equal to |A₁+A₂|×0.5. Inthis case, the maximum absolute value of the angle error Es isapproximately one half that of the error Ep shown in FIG. 18.

FIG. 20 is a waveform diagram illustrating the waveform of the angleerror Es when A₃ is −0.02. In FIG. 20, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₃ is −0.02, then |A₁+A₂+A₃| is 0. In this case, themaximum absolute value of the angle error Es is much smaller than thatof the error Ep shown in FIG. 18.

Example 4

Example 4 deals with a case where N is 4. Now, specific examples of thecases where A₀=1, A₁=0.01, A₂=0.01, and α=30° will be described withreference to FIG. 21 to FIG. 23.

FIG. 21 is a waveform diagram illustrating the waveform of the error Epof the uncorrected angle detection value θp. In FIG. 21, the horizontalaxis represents the detection-target angle θ, and the vertical axisrepresents the error Ep.

FIG. 22 is a waveform diagram illustrating the waveform of the angleerror Es when A₃ is −0.01. In FIG. 22, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₃ is −0.01, then |A₁+A₂+A₃| is equal to |A₁+A₂|×0.5. Inthis case, the maximum absolute value of the angle error Es isapproximately one half that of the error Ep shown in FIG. 21.

FIG. 23 is a waveform diagram illustrating the waveform of the angleerror Es when A₃ is −0.02. In FIG. 23, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₃ is −0.02, then |A₁+A₂+A₃| is 0. In this case, themaximum absolute value of the angle error Es is much smaller than thatof the error Ep shown in FIG. 21.

Example 5

Example 5 deals with a case where N is 5. Now, specific examples of thecases where A₀=1, A₁=0.01, A₂=0.01, and α=30° will be described withreference to FIG. 24 to FIG. 26.

FIG. 24 is a waveform diagram illustrating the waveform of the error Epof the uncorrected angle detection value θp. In FIG. 24, the horizontalaxis represents the detection-target angle θ, and the vertical axisrepresents the error Ep.

FIG. 25 is a waveform diagram illustrating the waveform of the angleerror Es when A₃ is −0.01. In FIG. 25, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₃ is −0.01, then |A₁+A₂+A₃| is equal to |A₁+A₂|×0.5. Inthis case, the maximum absolute value of the angle error Es isapproximately one half that of the error Ep shown in FIG. 24.

FIG. 26 is a waveform diagram illustrating the waveform of the angleerror Es when A₃ is −0.02. In FIG. 26, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₃ is −0.02, then |A₁+A₂+A₃| is 0. In this case, themaximum absolute value of the angle error Es is much smaller than thatof the error Ep shown in FIG. 24.

No specific examples are shown here for the cases where N is 6 or more.However, also in the cases where N is 6 or more, the present embodimentprovides the same effects as those in the cases where N is 5 or less.

Second Embodiment

A second embodiment of the invention will now be described. FIG. 27 is ablock diagram illustrating the configuration of a correction apparatus 3according to the second embodiment. The second embodiment differs fromthe first embodiment in the following ways.

In the correction processing according to the present embodiment, thecorrection value generator 36 determines the first and second correctionvalues C1 and C2 expressed in Eqs. (25) and (26) below, instead of Eqs.(7) and (8). A₄ is a real number such that |A₁+A₂+A₄| is less than|A₁+A₂|. |A₁+A₂+A₄| is preferably less than or equal to |A₁+A₂|×0.5.More preferably, |A₁+A₂+A₄| is 0. In the present embodiment, the orderof each of the first and second correction values C1 and C2 is N+1.

C1=−A ₄ sin((N+1)θp+α)  (25)

C2=−A ₄ cos((N+1)θp+α)  (26)

The correction information storage unit 37 stores the respective valuesof N, A₄ and α as the correction information, and supplies the values tothe correction value generator 36. The correction value generator 36uses the values of N, A₄ and α to determine the first and secondcorrection values C1 and C2 expressed in Eqs. (25) and (26).

In the present embodiment, the first and second corrected detectionsignals S1 c and S2 c are expressed in Eqs. (27) and (28) below,respectively.

$\begin{matrix}{{S\; 1c} = {{{S\; 1} + {C\; 1}} = {{A_{0}\sin \mspace{11mu} \theta} - {A_{1}{\sin \left( {{\left( {N - 1} \right)\mspace{11mu} \theta} + \alpha} \right)}} - {A_{2}{\sin \left( {{\left( {N + 1} \right)\mspace{11mu} \theta} + \alpha} \right)}} - {A_{4}{\sin \left( {{\left( {N + 1} \right)\mspace{11mu} \theta \; p} + \alpha} \right)}}}}} & (27) \\{{S\; 2c} = {{{S\; 2} + {C\; 2}} = {{A_{0}\cos \mspace{11mu} \theta} + {A_{1}\cos \; \left( {{\left( {N - 1} \right)\mspace{11mu} \theta} + \alpha} \right)} - {A_{2}{\cos \left( {{\left( {N + 1} \right)\mspace{11mu} \theta} + \alpha} \right)}} - {A_{4}{\cos \left( {{\left( {N + 1} \right)\mspace{11mu} \theta \; p} + \alpha} \right)}}}}} & (28)\end{matrix}$

According to the correction information determination procedure of thepresent embodiment, in step S104 shown in FIG. 11, A₄ is determinedinstead of A₃, based on A₁ and A₂. A₄ is determined so that |A₁+A₂+A₄|is less than |A₁+A₂|. A₄ is preferably determined so that |A₁+A₂+A₄| isless than or equal to |A₁+A₂|×0.5, more preferably, |A₁+A₂+A₄| is 0.

In the present embodiment, the first to third characteristics describedin relation to the first embodiment indicate the following. If|A₁+A₂+A₄| is less than |A₁+A₂|, it is possible to achieve a reductionin amplitude of the Nth-order angle error component as compared to whenno correction processing is performed. If |A₁+A₂+A₄| is less than orequal to |A₁+A₂|×0.5, it is possible to reduce the amplitude of theNth-order angle error component to approximately one half that in thecase where no correction processing is performed. If |A₁+A₂+A₄| is 0, itis possible to make the amplitude of the Nth-order angle error componentalmost zero.

In the present embodiment, each of the first and second correctionvalues C1 and C2 contains only an (N+1)th-order component even thougheach of the first and second detection signals S1 and S2 contains twosignal error components of the (N−1)th and (N+1)th orders. Thus, in thepresent embodiment the first and second correction values C1 and C2 aresimplified and the correction processing is simplified as well, as inthe first embodiment.

Examples 1 to 5 of the present embodiment will now be described.

Example 1

Example 1 deals with a case where N is 1. Now, specific examples of thecases where A₀=1, A₁=0.01, A₂=0.01, and α=30° will be described withreference to FIG. 12, FIG. 28 and FIG. 29. The waveform of the error Epof the uncorrected angle detection value θp in this case is asillustrated in FIG. 12.

FIG. 28 is a waveform diagram illustrating the waveform of the angleerror Es when A₄ is −0.01. In FIG. 28, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₄ is −0.01, then |A₁+A₂+A₄| is equal to |A₁+A₂|×0.5. Inthis case, the maximum absolute value of the angle error Es isapproximately one half that of the error Ep shown in FIG. 12.

FIG. 29 is a waveform diagram illustrating the waveform of the angleerror Es when A₄ is −0.02. In FIG. 29, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₄ is −0.02, then |A₁+A₂+A₄| is 0. In this case, themaximum absolute value of the angle error Es is much smaller than thatof the error Ep shown in FIG. 12.

Example 2

Example 2 deals with a case where N is 2. Now, specific examples of thecases where A₀=1, A₁=0.01, A₂=0.01, and α=30° will be described withreference to FIG. 15, FIG. 30 and FIG. 31. The waveform of the error Epof the uncorrected angle detection value θp in this case is asillustrated in FIG. 15.

FIG. 30 is a waveform diagram illustrating the waveform of the angleerror Es when A₄ is −0.01. In FIG. 30, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₄ is −0.01, then |A₁+A₂+A₄| is equal to |A₁+A₂|×0.5. Inthis case, the maximum absolute value of the angle error Es isapproximately one half that of the error Ep shown in FIG. 15.

FIG. 31 is a waveform diagram illustrating the waveform of the angleerror Es when A₄ is −0.02. In FIG. 31, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₄ is −0.02, then |A₁+A₂+A₄| is 0. In this case, themaximum absolute value of the angle error Es is much smaller than thatof error Ep shown in FIG. 15.

Example 3

Example 3 deals with a case where N is 3. Now, specific examples of thecases where A₀=1, A₁=0.01, A₂=0.01, and α=30° will be described withreference to FIG. 18, FIG. 32 and FIG. 33. The waveform of the error Epof the uncorrected angle detection value θp in this case is asillustrated in FIG. 18.

FIG. 32 is a waveform diagram illustrating the waveform of the angleerror Es when A₄ is −0.01. In FIG. 32, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₄ is −0.01, then |A₁+A₂+A₄| is equal to |A₁+A₂|×0.5. Inthis case, the maximum absolute value of the angle error Es isapproximately one half that of the error Ep shown in FIG. 18.

FIG. 33 is a waveform diagram illustrating the waveform of the angleerror Es when A₄ is −0.02. In FIG. 33, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₄ is −0.02, then |A₁+A₂+A₄| is 0. In this case, themaximum absolute value of the angle error Es is much smaller than thatof the error Ep shown in FIG. 18.

Example 4

Example 4 deals with a case where N is 4. Now, specific examples of thecases where A₀=1, A₁=0.01, A₂=0.01 and α=30° will be described withreference to FIG. 21, FIG. 34 and FIG. 35. The waveform of the error Epof the uncorrected angle detection value θp in this case is asillustrated in FIG. 21.

FIG. 34 is a waveform diagram illustrating the waveform of the angleerror Es when A₄ is −0.01. In FIG. 34, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₄ is −0.01, then |A₁+A₂+A₄| is equal to |A₁+A₂|×0.5. Inthis case, the maximum absolute value of the angle error Es isapproximately one half that of the error Ep shown in FIG. 21.

FIG. 35 is a waveform diagram illustrating the waveform of the angleerror Es when A₄ is −0.02. In FIG. 35, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₄ is −0.02, then |A₁+A₂+A₄| is 0. In this case, themaximum absolute value of the angle error Es is much smaller than thatof the error Ep shown in FIG. 21.

Example 5

Example 5 deals with a case where N is 5. Now, specific examples of thecases where A₀=1, A₁=0.01, A₂=0.01, and α=30° will be described withreference to FIG. 24, FIG. 36 and FIG. 37. The waveform of the error Epof the uncorrected angle detection value θp in this case is asillustrated in FIG. 24.

FIG. 36 is a waveform diagram illustrating the waveform of the angleerror Es when A₄ is −0.01. In FIG. 36, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₄ is −0.01, then |A₁+A₂+A₄| is equal to |A₁+A₂|×0.5. Inthis case, the maximum absolute value of the angle error Es isapproximately one half that of the error Ep shown in FIG. 24.

FIG. 37 is a waveform diagram illustrating the waveform of the angleerror Es when A₄ is −0.02. In FIG. 37, the horizontal axis representsthe detection-target angle θ, and the vertical axis represents the angleerror Es. If A₄ is −0.02, then |A₁+A₂+A₄| is 0. In this case, themaximum absolute value of the angle error Es is much smaller than thatof the error Ep shown in FIG. 24.

No specific examples are shown here for the cases where N is 6 or more.However, also in the cases where N is 6 or more, the present embodimentprovides the same effects as those in the cases where N is 5 or less.

The configuration, operation and effects of the present embodiment areotherwise the same as those of the first embodiment.

The present invention is not limited to the foregoing embodiments butvarious modifications may be made thereto. For example, the presentinvention is also applicable to magnetic angle sensors in which elementsthat are other than magnetoresistive elements and configured to detectmagnetic fields, such as Hall elements, are used as the magneticdetection elements.

Further, the present invention is applicable not only to magnetic anglesensors but to all types of angle sensors including optical anglesensors. The optical angle sensors may be ones configured to detect therelative position of an optical scale with respect to the angle sensor.The angle to be detected in such a case may be an angle that representsthe relative position of the optical scale with respect to the anglesensor with one pitch of the optical scale as 360°.

Obviously, many modifications and variations of the present inventionare possible in the light of the above teachings. Thus, it is to beunderstood that, within the scope of the appended claims and equivalentsthereof, the invention may be practiced in other embodiments than theforegoing most preferable embodiments.

What is claimed is:
 1. A correction apparatus for use with an anglesensor, the angle sensor including: a detection signal generator forgenerating a first detection signal and a second detection signal eachhaving a correspondence with an angle to be detected; and an angledetector for generating an angle detection value based on the first andsecond detection signals, the angle detection value having acorrespondence with the angle to be detected, the correction apparatusbeing configured to correct the first and second detection signals, andcomprising: a correction processor configured to perform correctionprocessing for generating a first corrected detection signal by adding afirst correction value to the first detection signal and generating asecond corrected detection signal by adding a second correction value tothe second detection signal, wherein the first detection signal containsa first ideal component, a first signal error component, and a secondsignal error component, the second detection signal contains a secondideal component, a third signal error component, and a fourth signalerror component, the first ideal component is expressed as A₀ sin θ, thesecond ideal component is expressed as A₀ cos θ, the first signal errorcomponent is expressed as −A₁ sin((N−1)θ+α), the second signal errorcomponent is expressed as −A₂ sin((N+1)θ+α), the third signal errorcomponent is expressed as A₁ cos((N−1)θ+α), and the fourth signal errorcomponent is expressed as −A₂ cos((N+1)θ+α), where θ represents theangle to be detected; N is an integer greater than or equal to 1; A₀,A₁, and A₂ are real numbers other than 0; and α is a predeterminedangle, the angle detection value without the correction processing beingreferred to as an uncorrected angle detection value θp, the uncorrectedangle detection value θp contains an error, and when the angle θ to bedetected varies with a predetermined period T, the error of theuncorrected angle detection value θp contains a component resulting fromthe first to fourth signal error components and varying with a period ofT/N, and the first correction value is expressed as −A₃ sin((N−1)θp+α),and the second correction value is expressed as A₃ cos((N−1)θp+α), whereA₃ is a real number such that |A₁+A₂+A₃| is less than |A₁+A₂|.
 2. Thecorrection apparatus according to claim 1, wherein |A₁+A₂+A₃| is lessthan or equal to |A₁+A₂|×0.5.
 3. The correction apparatus according toclaim 1, wherein |A₁+A₂+A₃| is
 0. 4. An angle sensor comprising: adetection signal generator for generating a first detection signal and asecond detection signal each having a correspondence with an angle to bedetected; an angle detector for generating an angle detection valuebased on the first and second detection signals, the angle detectionvalue having a correspondence with the angle to be detected; and thecorrection apparatus according to claim
 1. 5. The angle sensor accordingto claim 4, wherein the first detection signal has a correspondence witha sine of a rotating field angle, the second detection signal has acorrespondence with a cosine of the rotating field angle, and therotating field angle is an angle that a direction of a rotating magneticfield at a reference position forms with respect to a referencedirection in a reference plane, and that has a correspondence with theangle to be detected.
 6. A correction apparatus for use with an anglesensor, the angle sensor including: a detection signal generator forgenerating a first detection signal and a second detection signal eachhaving a correspondence with an angle to be detected; and an angledetector for generating an angle detection value based on the first andsecond detection signals, the angle detection value having acorrespondence with the angle to be detected, the correction apparatusbeing configured to correct the first and second detection signals, andcomprising: a correction processor configured to perform correctionprocessing for generating a first corrected detection signal by adding afirst correction value to the first detection signal and generating asecond corrected detection signal by adding a second correction value tothe second detection signal, wherein the first detection signal containsa first ideal component, a first signal error component, and a secondsignal error component, the second detection signal contains a secondideal component, a third signal error component, and a fourth signalerror component, the first ideal component is expressed as A₀ sin θ, thesecond ideal component is expressed as A₀ cos θ, the first signal errorcomponent is expressed as −A₁ sin((N−1)θ+α), the second signal errorcomponent is expressed as −A₂ sin ((N+1)θ+α), the third signal errorcomponent is expressed as A₁ cos ((N−1)θ+α), and the fourth signal errorcomponent is expressed as −A₂ cos ((N+1)θ+α), where θ represents theangle to be detected; N is an integer greater than or equal to 1; A₀,A₁, and A₂ are real numbers other than 0; and α is a predeterminedangle, the angle detection value without the correction processing beingreferred to as an uncorrected angle detection value θp, the uncorrectedangle detection value θp contains an error, and when the angle θ to bedetected varies with a predetermined period T, the error of theuncorrected angle detection value θp contains a component resulting fromthe first to fourth signal error components and varying with a period ofT/N, and the first correction value is expressed as −A₄ sin((N+1)θp+α),and the second correction value is expressed as −A₄ cos((N+1)θp+α),where A₄ is a real number such that |A₁+A₂+A₄| is less than |A₁+A₂|. 7.The correction apparatus according to claim 6, wherein |A₁+A₂+A₄| isless than or equal to |A₁+A₂|×0.5.
 8. The correction apparatus accordingto claim 6, wherein |A₁+A₂+A₄| is
 0. 9. An angle sensor comprising: adetection signal generator for generating a first detection signal and asecond detection signal each having a correspondence with an angle to bedetected; an angle detector for generating an angle detection valuebased on the first and second detection signals, the angle detectionvalue having a correspondence with the angle to be detected; and thecorrection apparatus according to claim
 6. 10. The angle sensoraccording to claim 9, wherein the first detection signal has acorrespondence with a sine of a rotating field angle, the seconddetection signal has a correspondence with a cosine of the rotatingfield angle, and the rotating field angle is an angle that a directionof a rotating magnetic field at a reference position forms with respectto a reference direction in a reference plane, and that has acorrespondence with the angle to be detected.